<template>
  <section class="main">
    <ul class="todo-list">
      <li class="todo" v-for="(e, i) in list" :key="e.id">
        <div class="view">
          <span class="index">{{ i + 1 }}.</span> <label>{{ e.todo }}</label>
          <button class="destroy" @click.prevent="del(e.id)"></button>
        </div>
      </li>
    </ul>
  </section>
</template>

<script>
export default {
  props: {
    list: {
      type: Array,
      required: true,
    },
  },
  methods: {
    del(id) {
      this.$emit("delList", id);
    },
  },
};
</script>

<style>
</style>